//
//  NewDiscussionSource.h
//  HiQ
//
//  Created by arvintan pang on 12-7-31.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Connection.h"
#import "NewDiscussionDelegate.h"
#import "PacketDispathCenter.h"

#pragma pack(1)
typedef struct
{
    NSUInteger userID;               // 用户id
    NSUInteger nameLen;              // 讨论组名字
    NSUInteger headImageLen;         // 群头像长度
    NSUInteger count;                // 讨论组人数
    //... 要发的 UserId 直接在这儿进行发送
} CLUSTERCREATEHRD;
#pragma pack()


#pragma pack(1)
typedef struct
{
    //NSUInteger error;
    NSUInteger groupID;               // 讨论组ID
    NSUInteger nameLen;               // 群名称长度
    NSUInteger headImageLen;         // 群头像长度
} CLUSTERCREATEREPLYHRD;
#pragma pack()

@interface NewDiscussionSource : NSObject<NSTableViewDataSource>
{
    Connection *_connection;
    id<NewDiscussionDelegate> _delegate;
}

@property NSMutableArray *_selectedArray;
@property id<NewDiscussionDelegate> _delegate;

+(id) shareNewDiscussion;
-(void) onReceiveNewDiscussionPacket:(NSData *)data;
-(void) sendNewDiscussionMsg:(NSString *)discussionName HeadIamge:(NSString*) headImage;
-(id) init;
-(NSInteger) selectedNum;
-(void) addMember:(id) member;
-(void) removeMembersAtIndexs:(NSIndexSet*) rows;

@end
